#include "frm_exercises.h"
#include "frm_diet.h"
#include "frm_beats.h"
#include "frm_profile.h"
#include "frm_exit.h"
#include "frm_menu.h"
#include "ui_frm_menu.h"
#include "frm_routine_menu.h"
#include "frm_free_exercise.h"
#include "frm_aboutas.h"
#include <QMessageBox>
#include <QDesktopWidget>


frm_menu::frm_menu(QDialog *parent) :
    QDialog(parent),
    ui(new Ui::frm_menu)
{
    ui->setupUi(this);
  //  setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowTitleHint);
   // setWindowFlags(Qt::WindowMinimizeButtonHint);
    setWindowFlags( Qt:: WindowTitleHint | Qt:: CustomizeWindowHint | Qt:: WindowMinimizeButtonHint );

    this->move(QApplication::desktop()->screen()->rect().center() - this->rect().center());
   //ui->cmdExercises->setIcon(QIcon(":/btn_exercises.png"));
}

frm_menu::~frm_menu()
{
    delete ui;
}


void frm_menu::on_cmdExercises_clicked()
{
    frm_free_exercise *fre_exer = new frm_free_exercise();
    this->hide();
    fre_exer->show();
}

void frm_menu::on_cmdDiets_clicked()
{
   frm_diet *diets = new frm_diet();
   this->hide();
   diets->show();
}

void frm_menu::on_cmdBeats_clicked()
{
   frm_beats *beats = new frm_beats(this);
   this->hide();
   beats->show();
}


void frm_menu::on_cmdProfile_clicked()
{
   frm_profile *profile = new frm_profile();
   this->hide();
   profile->show();
}

void frm_menu::on_cmdExit_clicked()
{
    frm_exit *exit = new frm_exit();
    this->hide();
    if (exit->exec())
        QApplication::closeAllWindows();
    else
        this->show();
}

void frm_menu::on_cmdRoutine_clicked()
{
    frm_routine_menu *routine = new frm_routine_menu();
    this->hide();
    routine->show();
}

void frm_menu::on_pushButton_clicked()
{
    frm_aboutas *about = new frm_aboutas();
    this->hide();
    about->show();
}
